package wisp.gui;

//GTGE GUI
import com.golden.gamedev.gui.*;
import com.golden.gamedev.gui.toolkit.*;

//JFC
import java.awt.Color;

//wisp
import wisp.dataObjects.*;
import wisp.game.PlayerSprite;

public class Inventory extends TFloatPanel{

	private PlayerSprite player;
	
	private TButton[] itemIcons = new TButton[40];
	
	private TButton useItem;
	private TButton moveItem;
	private TButton equipItem;
	private TButton throwItem;
	
	private TLabel itemPic;
	
	private int selectedIndex;
	public Inventory(PlayerSprite p){
		super("Knapsack", true, true, 450, 120, 300,200);
		
		player = p;
		int tx = 5;
		int ty = 5;
		
		selectedIndex = 0;
		
		itemPic = new TLabel("stuff here", 230, ty+10, 40, 40);
		itemPic.UIResource().put("Background Color", Color.GRAY.darker());
		
		for(int i = 0; i < 3; i++){
			tx = 5;
			
			for(int j = 0; j < 10; j++){
				itemIcons[i*10 + j] = new TButton("i", tx, ty, 20,20){
					public void doAction(){
						//select item contained in this index?
						//samthing like that.
						//or just return a position? HMMM.
						//depends sa code eh hmmm.
					}
				};
				tx += 20;
				itemIcons[i*10 + j].setVisible(true);
				this.add(itemIcons[i*10 + j]);
			}
			
			ty += 20;
		}
		
		ty += 20;
		
		useItem = new TButton("USE", 10, ty, 60, 20){
			//useItem(selectedIndex);
		};
		moveItem = new TButton("MOVE", 80, ty, 60, 20){
			//moveItem(selectedIndex);
		};
		equipItem = new TButton("EQUIP", 150, ty, 60, 20){
			//equipItem(selectedIndex);
		};
		
		throwItem = new TButton("THROW", 220, ty, 60, 20){
			//throwItem(selectedIndex);
		};
		
		this.add(itemPic);
		this.add(useItem);
		this.add(moveItem);
		this.add(equipItem);
		this.add(throwItem);
	}

}
